<?php

// $Id$


require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/hidden/form_field_hidden_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/integer_limited/form_field_integer_limited_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/integer/form_field_integer_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');


class Menu_Item_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_label = $form->get_field('label');
		$f_label_view = new Form_Field_Text_View($form->get_name().'_'.$f_label->get_name(), $f_label);
		$this->add_field_view('label', $f_label_view);

		$f_parent = $form->get_field('parent');
		$f_parent_view = new Form_Field_Hidden_View($form->get_name().'_'.$f_parent->get_name(), $f_parent);
		$this->add_field_view('parent', $f_parent_view);


		$f_link = $form->get_field('link');
		$f_link_view = new Form_Field_Text_View($form->get_name().'_'.$f_link->get_name(), $f_link);
		$this->add_field_view('link', $f_link_view);


		$f_hid = $form->get_field('hid');
		$f_hid_view = new Form_Field_Text_View($form->get_name().'_'.$f_hid->get_name(), $f_hid);
		$this->add_field_view('hid', $f_hid_view);

		$f_target = $form->get_field('target');
		$f_target_view = new Form_Field_Text_View($form->get_name().'_'.$f_target->get_name(), $f_target);
		$this->add_field_view('target', $f_target_view);

		$f_order = $form->get_field('order');
		$f_order_view = new Form_Field_Integer_Limited_View($form->get_name().'_'.$f_order->get_name(), $f_order);
		$this->add_field_view('order', $f_order_view);
	}
}